package com.baobo.springframework;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author baobo
 */
public class BeanFactory {
    private Map<String,BeanDefinition> beanDefinitionMap = new ConcurrentHashMap<>();

    public Object getBean(String beanName){
        //先拿到bean的定义对象 在拿到对应的bean
        return beanDefinitionMap.get(beanName).getBean();
    }

    public void registerBeanDefinition(String beanName,BeanDefinition beanDefinition){
        beanDefinitionMap.put(beanName,beanDefinition);
    }

}
